<!DOCTYPE HTML>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>GitLog.js example page</title>
    <style>
        body,
        html {
            margin: 0;
            padding: 0;
            height: 100%
        }
        .tree-row {
            margin-left: 20px;
        }
        #detail {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
        
        .row {
            height: 20px
        }
        
        .merge {
            color: lightgray
        }
        
        svg {
            pointer-events: none
        }
        
        path,
        circle {
            pointer-events: auto
        }
        
        path:hover {
            stroke: bisque;
            stroke-width: 3;
        }
        .branch {
            background: #DAEDB3;
            color: black;
            border: 1px solid yellowgreen;
            box-sizing: border-box;
            padding: 2px;
            border-radius: 4px;
            display: inline-block;
        }
    </style>
</head>

<body>

    <div id="detail"></div>
    <script src="/static/mini_require.js"></script>
    <script src="/configs/require_config.js"></script>
    <script src="/static/test.js"></script>

    <script src="./data.json"></script>
    <script>
        function describe() {}
        require(["lib/chai/chai", "text!/vfs-root", "ace_tree/tree",
            "ace_tree/data_provider", "plugins/c9.ide.scm/log/log"
        ], function(chai, baseProc, Tree, DataProvider, GitGraph) {
            var expect = require("lib/chai/chai").expect;
            expect.setupArchitectTest([
                {
                    packagePath: "plugins/c9.core/c9",
                    startdate: new Date(),
                    debug: false,
                    hosted: true,
                    local: false,
                    davPrefix: "/"
                },
                "plugins/c9.core/http-xhr",
                "plugins/c9.core/ext",
                "plugins/c9.core/settings",
                "plugins/c9.core/util",
                "plugins/c9.core/api",
                {
                    packagePath: "plugins/c9.fs/fs",
                    baseProc: baseProc
                },
                "plugins/c9.fs/proc",
                "plugins/c9.vfs.client/vfs_client",
                "plugins/c9.vfs.client/endpoint",
                "plugins/c9.ide.auth/auth",
                {
                    consumes: ["proc"],
                    provides: [],
                    setup: main
                },
                // "plugins/c9.ide.scm/scm",
                // "plugins/c9.ide.scm/scmpanel",
                // "plugins/c9.ide.scm/detail",
                // "plugins/c9.ide.scm/log",
                // "plugins/c9.ide.scm/editor",
                "plugins/c9.ide.scm/git",
            ]);
            function main(options, imports, register) {
                window.proc = options.proc;
                // app.services["scm.git"].getLog({count: 10000}, function(e, d) {
                //     console.log(e, d)
                // })
                
                var tree = new Tree(document.getElementById("detail"));
                window.tree = tree;
                tree.setDataProvider(new DataProvider);
                tree.model.rowHeight = 20;
                new GitGraph().attachToTree(tree);
                tree.model.loadData(data);
                window.addEventListener("resize", function() {
                    tree.resize();
                });
                register(null, {
                    
                });
            }
        });
    </script>
</body>

</html>
